// (C) Andreas Kaiser 2008

#ifndef _RFM01_H
#define _RFM01_H

#include "rf01.h"

#if RFM_BUFFER
extern volatile uint8_t	rfm_buffer[];
extern volatile uint8_t	rfm_length;
#endif

void		rfm_init (uint16_t frequency, uint16_t clockout);
uint16_t	rfm_cmd (uint16_t cmd);
uint16_t	rfm_status (void);
int		rfm_error (void);		// return 1 when overflow

void		rfm_rx_start (uint16_t ctrl);	// start receiver (ctrl: RF01RCTL_Gain/RSSI)
int		rfm_rx_stop  (void);		// stop receiver, return 0 when ok

#define RFM_NOTREADY	-1
#define RFM_OVERRUN	-2
#define RFM_CRCFAIL	-3
#define RFM_NOSIGNAL	-4

#endif //_RFM01_H
